
/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package Apusic.impl;

import Apusic.ApusicPackage;
import Apusic.LoggingCfg;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;
import javax.management.ObjectName;
import org.eclipse.emf.ecore.EObject;
import com.apusic.admin.config.*;
import com.apusic.admin.*;

import cn.edu.pku.sei.ra.wrapping.CommonWrapping.WrappingEObject;
import cn.edu.pku.sei.ra.wrapping.CommonWrapping.impl.WrappingEObjectImpl;
import cn.edu.pku.sei.ra.wrapping.CommonWrapping.util.EObjectContainmentEListForWrapping;
import cn.edu.pku.sei.ra.wrapping.CommonWrapping.util.EObjectResolvingEListForWrapping;
import cn.edu.pku.sei.ra.wrapping.CommonWrapping.util.ImagePool;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Set;
/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Logging Cfg</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link Apusic.impl.LoggingCfgImpl#getConsoleFormatter <em>Console Formatter</em>}</li>
 *   <li>{@link Apusic.impl.LoggingCfgImpl#getConsoleLevel <em>Console Level</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class LoggingCfgImpl extends WrappingEObjectImpl implements LoggingCfg
{
  /**
   * The default value of the '{@link #getConsoleFormatter() <em>Console Formatter</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getConsoleFormatter()
   * @generated
   * @ordered
   */
  protected static final String CONSOLE_FORMATTER_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getConsoleFormatter() <em>Console Formatter</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getConsoleFormatter()
   * @generated
   * @ordered
   */
  protected String consoleFormatter = CONSOLE_FORMATTER_EDEFAULT;

  /**
   * The default value of the '{@link #getConsoleLevel() <em>Console Level</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getConsoleLevel()
   * @generated
   * @ordered
   */
  protected static final String CONSOLE_LEVEL_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getConsoleLevel() <em>Console Level</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getConsoleLevel()
   * @generated
   * @ordered
   */
  protected String consoleLevel = CONSOLE_LEVEL_EDEFAULT;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected LoggingCfgImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return ApusicPackage.Literals.LOGGING_CFG;
  }

  
  

  
  
  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */ 
   public boolean isForCore(Object arg0){
   	boolean result=true;
   	if(core==null) return false;
    try{
    result=true;
    }
    catch(Exception e){
      result=false;
    }
    return result;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */ 
  public List listSubCores(int featureID){
    List result=new ArrayList();
  
    LoggingConfig core=(LoggingConfig)this.getCore();
    if(core==null) 
      return result;
    switch(featureID){
    
  
  
  }
    return result;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */ 
  public EClass getChildClassMap(Object object){
    ApusicPackage pack=ApusicPackage.eINSTANCE;	
  
  
  
    return null;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getConsoleFormatter()
  {
        Object result=null;
        LoggingConfig core=(LoggingConfig)getCore();
        if(core==null) return consoleFormatter;	
        try
{
consoleFormatter=core.getConsoleFormatter();
}
catch(Exception e)
{
  consoleFormatter = null;
}
    return consoleFormatter; 
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setConsoleFormatter(String newConsoleFormatter)
  {
    String oldConsoleFormatter = consoleFormatter;
    consoleFormatter = newConsoleFormatter;
        	
      LoggingConfig core=(LoggingConfig)getCore();
      if(core==null) return;
      	
        
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, ApusicPackage.LOGGING_CFG__CONSOLE_FORMATTER, oldConsoleFormatter, consoleFormatter));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getConsoleLevel()
  {
        Object result=null;
        LoggingConfig core=(LoggingConfig)getCore();
        if(core==null) return consoleLevel;	
        try
{
consoleLevel=core.getConsoleLevel();
}
catch(Exception e)
{
  consoleLevel = null;
}
    return consoleLevel; 
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setConsoleLevel(String newConsoleLevel)
  {
    String oldConsoleLevel = consoleLevel;
    consoleLevel = newConsoleLevel;
        	
      LoggingConfig core=(LoggingConfig)getCore();
      if(core==null) return;
      	
        
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, ApusicPackage.LOGGING_CFG__CONSOLE_LEVEL, oldConsoleLevel, consoleLevel));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case ApusicPackage.LOGGING_CFG__CONSOLE_FORMATTER:
        return getConsoleFormatter();
      case ApusicPackage.LOGGING_CFG__CONSOLE_LEVEL:
        return getConsoleLevel();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case ApusicPackage.LOGGING_CFG__CONSOLE_FORMATTER:
        setConsoleFormatter((String)newValue);
        return;
      case ApusicPackage.LOGGING_CFG__CONSOLE_LEVEL:
        setConsoleLevel((String)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case ApusicPackage.LOGGING_CFG__CONSOLE_FORMATTER:
        setConsoleFormatter(CONSOLE_FORMATTER_EDEFAULT);
        return;
      case ApusicPackage.LOGGING_CFG__CONSOLE_LEVEL:
        setConsoleLevel(CONSOLE_LEVEL_EDEFAULT);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case ApusicPackage.LOGGING_CFG__CONSOLE_FORMATTER:
        return CONSOLE_FORMATTER_EDEFAULT == null ? consoleFormatter != null : !CONSOLE_FORMATTER_EDEFAULT.equals(consoleFormatter);
      case ApusicPackage.LOGGING_CFG__CONSOLE_LEVEL:
        return CONSOLE_LEVEL_EDEFAULT == null ? consoleLevel != null : !CONSOLE_LEVEL_EDEFAULT.equals(consoleLevel);
    }
    return super.eIsSet(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public String toString()
  {
    if (eIsProxy()) return super.toString();

    StringBuffer result = new StringBuffer(super.toString());
    result.append(" (consoleFormatter: ");
    result.append(consoleFormatter);
    result.append(", consoleLevel: ");
    result.append(consoleLevel);
    result.append(')');
    return result.toString();
  }

} //LoggingCfgImpl
